package net.yihang.jpa.service;

import net.yihang.entity.Order;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

@Service
public class OrderService {

    @PersistenceContext
    private EntityManager em;

    @Transactional
    public Order find(int id) {
        return em.find(Order.class, id);
    }
}
